<style include="cr-icons">
  :host {
    align-items: center;
    background-color: var(--mwb-background-color);
    display: flex;
    height: var(--mwb-item-height);
    padding: 0 var(--mwb-list-item-horizontal-margin);
    user-select: none;
  }

  :host([has-search-text]) label {
    visibility: hidden;
  }

  #searchIcon {
    height: var(--mwb-icon-size);
    padding-inline-end: var(--mwb-list-item-horizontal-margin);
    width: var(--mwb-icon-size);
  }

  #searchWrapper {
    display: flex;
    flex: 1;
    height: 100%;
    position: relative;
  }

  #searchLabel {
    align-items: center;
    color: var(--cr-secondary-text-color);
    cursor: text;
    display: flex;
    font-size: var(--mwb-primary-text-font-size);
    height: 100%;
    justify-content: space-between;
    position: absolute;
    width: 100%;
  }

  #searchInput {
    background-color: transparent;
    border: none;
    border-radius: 0;
    color: var(--cr-primary-text-color);
    flex: 1;
    font-family: inherit;
    font-size: var(--mwb-primary-text-font-size);
    font-style: inherit;
    outline: none;
    padding: 0;
    text-overflow: ellipsis;
  }

  #searchInput::-webkit-search-cancel-button {
    display: none;
  }

  @media (prefers-color-scheme: dark) {
    #searchIcon {
      color: var(--google-blue-300);
    }
  }

  #inputAnnounce,
  #searchResultText {
    clip: rect(0,0,0,0);
    display: inline-block;
    position: fixed;
  }
</style>

<iron-icon id="searchIcon" icon="mwb16:search"></iron-icon>
<div id="searchWrapper">
  <label id="searchLabel" for="searchInput" aria-hidden="true">
    <span>[[label]]</span>
    <span>[[shortcut_]]</span>
    <span id="searchResultText">[[searchResultText]]</span>
  </label>
  <input id="searchInput" aria-labelledby="searchLabel"
      autofocus="[[autofocus]]" autocomplete="off"
      on-search="onSearchTermSearch" on-input="onSearchTermInput" type="search"
      spellcheck="false" aria-describedby="inputAnnounce"
      on-blur="onInputBlur_">
  <span id="inputAnnounce" aria-live="assertive">
    [[announceText_]]
  </span>
</div>
